<!-- 订单日期控件 -->
<template>
  <a-space direction="vertical" style="width: 100%">
    <a-date-picker
      v-model="modelValue"
      show-time
      format="YYYY-MM-DD HH:mm"
      placeholder="系统自动生成"
      disabled
    />
  </a-space>
</template>

<script lang="ts" setup>
  import { ref, computed } from 'vue';

  const props = withDefaults(
    defineProps<{
      props: { [propName: string]: any };
      name?: string;
      required?: boolean;
      oneValue: any;
      regex?: {
        [name: string]: {
          role: any;
          name: any;
        };
      };
    }>(),
    {}
  );
  const emit = defineEmits(['update:oneValue']);
  const modelValue = computed({
    get: () => {
      return props.oneValue ? props.oneValue : new Date();
    },
    set: (val) => {
      emit('update:oneValue', val);
    },
  });
</script>

<style scoped lang="less"></style>
